<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>  JSON  常用方法</h1>
    格式要求： {"属性":值 ,"属性":值}

    <script>
     var obj = { msg:'获取3条笑话',code:200}

     //  json ---> string
     var str = JSON.stringify( obj)
     console.log( obj.msg )
     console.log( str.msg ,str )
     // string -- > json
     var t = JSON.parse( str )
     console.log( t , t.msg );
   



    </script>
</body>
</html>